<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
<script src="lib/jquery-3.3.1.min.js"></script>
<script src="lib/bootstrap.min.js"></script>
<script src="lib/vue.js"></script>
</head>
<body>
	This is a test
	<div id="app">
		<p>{{items[1].titleImg}}</p>
		<p>{{items[1].name}}</p>
		<p>{{items[1].discountMsg}}</p>
		<p>{{items[1].price}}</p>
		<p>{{items[1].label}}</p>
		<img v-bind:src="items[1].titleImg"/>
	</div>
	<script>
		/* var txt = '{ "employees" : [' +
		'{ "firstName":"Bill" , "lastName":"Gates" },' +
		'{ "firstName":"George" , "lastName":"Bush" },' +
		'{ "firstName":"Thomas" , "lastName":"Carter" } ]}';
		var jsonObj3=eval("("+txt+")");
		console.log(jsonObj3); */
		
		//将商品列表的数组型字符串转为json数组型对象
		var jsonstr='${requestScope.items}';
		console.log(jsonstr);
		var jsonobj=$.parseJSON(jsonstr);
		//var jsonobj=eval("("+jsonstr+")");
		console.log(jsonobj);
		
		var fcid='${requestScope.fcid}';
		var fcName='${requestScope.fcName}';
		var scid='${requestScope.scid}';
		var scName='${requestScope.scName}';
		var scList='${requestScope.scList}';
		console.log(fcid+":"+fcName+scid+":"+scName);
		console.log(scList);
		var app=new Vue({
			el:"#app",
			data:{
				items:jsonobj,
				age:21,
			},
		});
	</script>
</body>
</html>